<?php
namespace Yzadmin\Controller;
use Common\Controller\AdminBaseController;
/**
 * 后台首页控制器
 */
class IndexController extends AdminBaseController {
    /**
     * 首页
     */
    public function index(){
        check_login();
        // 分配菜单数据
        $nav_data=get_nav();
        $adminInfo = get_adminInfo();
        $assign=array(
            'nav_data'=>$nav_data,
            'admin_group'=>$adminInfo['catid'],
            'adminInfo'=>$adminInfo
            );
        $this->assign($assign);
        $this->display();
    }
    /**
     * elements
     */
    public function elements(){
        $this->display();
    }

    /**
     * welcome
     */
    public function welcome(){
      $Config = M('Config')->find(1);
      $adminUser = session('user_auth');
      $adminInfo = get_adminInfo();
      $assign=array(
          'Config'=>$Config,
          'admin_uid'=>$adminUser['uid'],
          'adminInfo'=>$adminInfo
          );
      $this->assign($assign);
      $this->display();
    }
}
